<%@ page import="java.sql.*, javax.sql.*, javax.naming.*" %>
<%@page import="support.*, java.util.*" %>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>

    <%
    // Connect to ConnectionPool
    Connection conn = null;
    try{
        Context initCtx = new InitialContext();
        DataSource ds = (DataSource)initCtx.lookup("java:comp/env/jdbc/CS135");
        conn = ds.getConnection();
    }finally{
    }
    Statement stmt = conn.createStatement();
    %>
    
    <%
    // use sql statement to display all the specializations
    ResultSet rset = stmt.executeQuery("SELECT * FROM specializations");
    %>  

    Choose a specialization
    <!-- creates drop menu of specializations -->
    <form method="get" action="verification.jsp">
      <select name="specialization">
        <% 
        while(rset.next()){
            out.print("<option value=\"" + rset.getString(1) + "\">"
                    + rset.getString(1) + "</option>");
        }
        %>
      </select> 
    <input type="submit" name="submit">
    </form>
</body>
</html>